<?php if (!defined('THINK_PATH')) exit();?><form id="pagerForm" action="/Admin/Link/index" method="post">
    <input type="hidden" name="pageNum" value="<?php echo ($page['pageNum']); ?>"/>
<input type="hidden" name="numPerPage" value="<?php echo ($page['numPerPage']); ?>" />
    <input type="hidden" name="pid" value="<?php echo ($parameter['pid']); ?>"/>
</form>
<style>tr td,th{text-align:center}.typestyle{padding: 2px 6px;font-size: 13px;color: #fff;border-radius: 4px;}</style>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" action="/Admin/Link/index/" method="post">
    	<input type="hidden" name="pid" value="<?php echo ($parameter['pid']); ?>"/>
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td></td>
                </tr>
            </table>
            <div class="subBar">
                <!--ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">检索</button>
                            </div>
                        </div>
                    </li>
                </ul-->
            </div>
        </div>
    </form>
</div>

<div class="pageContent">
    <div class="panelBar" style="background:none;">
        <ul class="toolBar">
            <li>
                <a href="<?php echo U('Link/add/',array('type'=>$type,'model'=>$parameter['model'],'pid'=>$parameter['pid']));?>" class="add" rel="add" target="dialog" title="添加广告图">
                    <i class="iconfont">&#xe601;</i>
                    <span>添加</span>
                </a>
            </li>

            <li>
                <a href="<?php echo U('Link/edit',array('model'=>$parameter['model']),'','');?>/id/{sid_user}" class="edit" rel="edit" target="dialog" title="编辑幻灯片">
                    <i class="iconfont">&#xe625;</i>
                    <span>编辑</span>
                </a>
            </li>

            <li>
                <a class="delete" href="<?php echo U('Link/remove',array('model'=>$parameter['model']));?>" target="selectedTodo" rel="id" posttype="string" title="你确定要批量删除吗？">
                    <i class="iconfont">&#xe611;</i>
                    <span>删除</span>
                </a>
            </li>

        </ul>
    </div>
    <table class="table" width="100%" layoutH="206">
        <thead>
            <tr>
                <th width="3%" class="txtMid">
                    <input type="checkbox" group="id" class="checkboxCtrl">
                </th>
                <th width="5%">编号</th>
                <th width="20%">标题</th>
                <th width="10%">图片</th>
                <th width="20%">链接地址</th>
                <th width="10%">创建时间</th>
	            <th width="5%">排序</th>
	            <th width="5%">状态</th>
	            <th width="10%">操作</th>
            </tr>
        </thead>
        <tbody>
        <?php if($dataList|count > 0): if(is_array($dataList)): $i = 0; $__LIST__ = $dataList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$volist): $mod = ($i % 2 );++$i;?><tr target="sid_user" rel="<?php echo ($volist['id']); ?>" >
                <td class="txtMid">
                    <input name="id" value="<?php echo ($volist['id']); ?>" type="checkbox">
                </td>
                <td><?php echo ( $page['pageNum'] - 1 ) * $page['numperpage'] + ( $key + 1 );?></td>
                <td>
                    <a href="<?php echo U('Link/edit',array('model'=>$parameter['model'],'id'=>$volist['id']));?>" class="alink1" target="dialog" title='编辑幻灯片'>
                        <?php echo ($volist['title']); ?>
                    </a>
                </td>
                <td>
                	<a href="<?php echo ($volist['picture']); ?>"  target="_blank" rel="example_group" >
                        <img src="<?php echo ($volist['picture']); ?>" style="max-height: 50px;"/>
                    </a>
                </td>
                <td><?php echo ($volist['link']); ?></td>
                <td><?php echo (date('Y-m-d H:i:s',$volist['create_time'])); ?></td>
                <td><?php echo ($volist['sort']); ?></td>
                <td>
                    <?php if($volist['status'] == 0): ?><span class="typestyle" style="line-height:60px;background-color:#90EE90;">显示</span>
                    <?php else: ?>
                    	<span class="typestyle" style="line-height:60px;background-color:#EE3B3B;">隐藏</span><?php endif; ?>
                </td>
                <td>
					<?php if($volist['status'] == 1): ?><a href="<?php echo U('Link/commSetStatus',array('model'=>$parameter['model'],'param'=>'status-0','id'=>$volist['id']));?>" target="ajaxTodo" class="color_red">[恢复]</a>
					<?php else: ?>
						<a href="<?php echo U('Link/commSetStatus',array('model'=>$parameter['model'],'param'=>'status-1','id'=>$volist['id']));?>" target="ajaxTodo" class="alink1">[禁用]</a><?php endif; ?>
                </td>
            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
        <?php else: ?>
            <tr><td colspan="10" style="text-align:center;">没有数据!!!</td></tr><?php endif; ?>
        </tbody>
    </table>
    <div class="panelBar" style="background:none;">
    <div class="pages">
        <span>显示</span>
        <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
            <?php if(is_array($page['numPerPageArray'])): foreach($page['numPerPageArray'] as $key=>$vo): ?><option value="<?php echo ($vo); ?>"<?php if($vo == $page['numPerPage']): ?>selected='selected'<?php endif; ?>><?php echo ($vo); ?></option><?php endforeach; endif; ?>
        </select>
        <span>条，共<?php echo ($page['all']); ?>条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="<?php echo ($page['all']); ?>" numPerPage="<?php echo ($page['numPerPage']); ?>" pageNumShown="10" currentPage="<?php echo ($page['pageNum']); ?>"></div>
</div>
</div>